/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package logging;

import java.util.Date;
import logging.LogLevel.Level;

/**
 *
 * @author Marco
 */
public class ConsoleAppender extends IAppender {

    @Override
    public void configure() {
    }

    @Override
    public void write(Level level, String msg, Exception ex) {
        System.err.println(Logger.getDateFormat().format(new Date()) + " " + level.toString() + " " + msg + " " + ex.getMessage() + " " +ex);
    }

    @Override
    public String toString() {
        return "ConsoleLogLevel";
    }

    @Override
    public void write(Level level, String msg) {
        System.out.println(Logger.getDateFormat().format(new Date()) + " " + level.toString() + " "+ (msg.equals("") ? "OK" : msg));
    }

}
